cpplint: Use pypi version - #1871
Conversation
Also does not need python 2 anymore
|
Thanks for the patch. Is this just configuring the Python 3 version to work like our Python 2 version did? Or does this change code to comply? I couldn't quite follow from the PR notes. There's always a copyright holder for code. That's the author by default, or their employer if they assign copyright to code to their employer (as most employers, including most universities, require). We asked explicitly to get a record of copyright holders and to make sure contributors were OK licensing it open source. I intentionally wanted to keep the contributors as copyright holders so that nobody could try to seize control of the whole project. What I think is probably a better approach now is to remind users that they have to have copyright and contribute according to our licensing from the GitHub terms of service, to which we can point in the PR template. That'd stop me from nagging everyone to fill in the PR template and I think we're still OK on copyright. This is what @seantalts did proactively for the stanc3 repo, but we haven't adopted that practice in the main math or stan repos. |
|
Sorry for the confusion. This PR just switches to the I have updated the PR with the relevant copyright. |
|
@serban-nicusor-toptal do we need to update the jenkins machines to use python3 as well? |
|
All the machines should have python3 installed, does this PR require any change to the Jenkinsfile ? |
|
No. jenkins calls make cpplint. This changes what happens underneath. |
|
Good, I'll double-check all machines now for python3 to be sure. I'll comment here when done. |
rok-cesnovar
left a comment
There was a problem hiding this comment.
This is great! Thanks for this patch. I don't think we need the /samples folder but it's not huge so we can also leave it in. Lets wait for @serban-nicusor-toptal to re-check the status of Python3 on Jenkins and then merge.
I agree. I feel that this way of doing it by first replacing cpplint and then applying the changes to follow guidelines will be easier to review. |
|
Hey, here are the results: Will this create a problem on mac ? I don't have root access to it. |
|
Restarted the tests so that the upstream Stan branch points to the stan-dev/stan PR. @serban-nicusor-toptal can we remove the mac machine for cpplint until someone either gives you acess or upgrades to python 3. |
|
Done. |
|
@serban-nicusor-toptal Is the hold up in this test https://jenkins.mc-stan.org/blue/organizations/jenkins/Stan/detail/PR-2916/3/pipeline/142 |
|
Hey, sadly no. Jenkins will spin up new Linux nodes as the queue is growing, lately, we've had a bit of delay because of almost all machines in AWS being used. ( Note: We are using Spot Instances which are 70-80% cheaper but if someone pays the full price aka on-demand for the instance we lose it ) AWS Logs Example: How to figure this out without having access to AWS ? I will add new types of machines ( a bit more expensive ) to get us more chances for a machine type, tho lately most of the machine types are being depleted. More information about Spot Requests |
|
Oh yeah, that makes sense with a lot of people working from home these days. I guess. Thanks for the explanation. |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
|
@HaoZeke congrats on your first merged PR to the Stan Math repository. 🎉 |
|
Thanks @rok-cesnovar and everyone else. It was fun! Should I start applying more of the default linter rules to the code? Perhaps that should be an issue or a discourse post, since people who are working with the code right now should be informed or they will suddenly see a lot of broken tests. Update: Made a discourse post |

Summary
Python 2 has been depreciated for quite a while now, and it isn't mandated by any other part of the process.
The fork on pypi is probably the one most people will expect anyway, so have simply replaced the existing
cpplintwith that, adding to the ignore rules to ensure no further changes are required at this point.P.S.: I would actually prefer to follow the flag guidelines, but let me know if that would be too invasive of a change.
Tests
With the new
cpplint:With the old one:
The most common errors are essentially related to ordering of system libraries and the fact that the newer guidelines like the guards to be in a different format, as well as the suggestion of having a C style string for global and static strings:
Have currently ignored these suggestions (
flagerrors format):build/include_order3301build/header_guard2805build/namespaces3runtime/string36build/include_what_you_use23To ensure
make cpplintdoes not error out, but am happy to update as per the linter guidelines as well.TL;DR- Post PR:
i.e. no change.
Side Effects
Will have to make a similar PR to clean up the
make/cpplintfile instan-dev/stanas well.Release notes
Updated
cpplintto conform topypiChecklist
Math issue #(issue number) N/A
Copyright holder: Rohit Goswami <rg0swami[at]yahoo.com>
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit)make test-headers)make test-math-dependencies)make doxygen)make cpplint)The
doxygentest has issues (depreciation warnings), but not related to this PR, and not with the version ofdoxygenspecified.the code is written in idiomatic C++ and changes are documented in the doxygen N/A
the new changes are tested